package com.kmxd.ams.client.archive.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 整理规则-规则字段
 *
 * @author nickbi
 * @since 2022-07-30
 */
@Data
@ColumnWidth(15)
@HeadRowHeight(15)
@ContentRowHeight(15)
@HeadStyle
@HeadFontStyle(fontHeightInPoints = 12)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@ContentFontStyle(fontHeightInPoints = 10)
@ExcelIgnoreUnannotated
@Schema(description = "整理规则-规则字段对象")
public class ArchiveRuleFieldListVO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "主键ID")
  private Long id;

  @Schema(description = "门类配置id 将s_archive_rule表中的arch_type_id冗余过来，便于查询")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "门类配置id 将s_archive_rule表中的arch_type_id冗余过来，便于查询")
  private Long archTypeId;

  @Schema(description = "规则id 关联s_archive_rule表主键")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "规则id 关联s_archive_rule表主键")
  private Long ruleId;

  @Schema(description = "字段英文名称")
  @ExcelProperty(value = "字段英文名称")
  private String fieldCode;

  @Schema(description = "字段中文名称")
  @ExcelProperty(value = "字段中文名称")
  private String fieldName;

  @Schema(description = "创建人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "创建人")
  private Long createBy;

  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "创建时间")
  private Date createTime;

  @Schema(description = "更新人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "更新人")
  private Long updateBy;

  @Schema(description = "更新时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "更新时间")
  private Date updateTime;

  @Schema(description = "表名")
  @ExcelProperty(value = "表名")
  private String tableId;

  /** 启用分组:0不启用,1启用 */
  @Schema(description = "启用分组:0不启用,1启用")
  private Boolean enableGroup;

  @Schema(description = "启用盒分组:0不启用,1启用")
  @ExcelProperty(value = "启用盒分组:0不启用,1启用")
  private Boolean enableBoxGroup;

  @Schema(description = "前置拼接字段")
  @ExcelProperty(value = "前置拼接字段")
  private String spliceField;

  @Schema(description = "流水字段:0不启用,1启用")
  @ExcelProperty(value = "流水字段:0不启用,1启用")
  private Boolean enableIncrement;

  @Schema(description = "排序")
  @ExcelProperty(value = "排序")
  private Integer sort;

  /** 类型 */
  @Schema(description = "类型: 1元数据字段，2固定内容")
  @ExcelProperty(value = "类型: 1元数据字段，2固定内容")
  private Integer type;

  /** 字典相关字典使用value还是name */
  @Schema(description = "字典相关字典使用value还是name")
  private String dictField;
}
